package com.numberma.userservice.Utils;

//AI生成
public class CheckPasswordUtil {
    public static boolean CheckPassword(String password) {
        if (password == null || password.length() < 8 || password.length() > 20) {
            return false;
        }
        boolean hasLetter = false;
        boolean hasDigit = false;

        for (char c : password.toCharArray()) {
            if (Character.isLetter(c)) hasLetter = true;
            if (Character.isDigit(c)) hasDigit = true;
            if (hasLetter && hasDigit) return true;
        }
        return false;
    }
}
